#include "widget.h"
#include "ui_widget.h"
#include<QDebug>
#include<QRect>
Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);
   ui->textEdit->setUndoRedoEnabled(true);
   ui->textEdit->setPlaceholderText("文字的力量是强大的，让我们一起来述说心情吧~");
   ui->textEdit->autoFormatting();
    ui->textEdit->setTabStopDistance(40.0);
    ui->textEdit->setVerticalScrollBarPolicy(Qt::ScrollBarAsNeeded);
    ui->textEdit->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOn);
}

Widget::~Widget()
{
    delete ui;
}


void Widget::on_textEdit_textChanged()
{

    QString content=ui->textEdit->toPlainText();
    qDebug()<<content;
    ui->label->setText(content);
}
